package cn.lijiajia3515.cairo.auth.modules.account;

import cn.lijiajia3515.cairo.core.extension.Extension;

import java.util.Arrays;
import java.util.Set;
import java.util.stream.Collectors;

import static cn.lijiajia3515.cairo.auth.modules.account.AccountField.AVATAR_URL;
import static cn.lijiajia3515.cairo.auth.modules.account.AccountField.EMAIL;
import static cn.lijiajia3515.cairo.auth.modules.account.AccountField.NAME;
import static cn.lijiajia3515.cairo.auth.modules.account.AccountField.PHONE_NUMBER;
import static cn.lijiajia3515.cairo.auth.modules.account.AccountField.USERNAME;

public enum AccountExtension implements Extension<AccountField> {
	BASIC(NAME),
	INFO(NAME, USERNAME, PHONE_NUMBER, EMAIL, AVATAR_URL),
	ALL(AccountField.values());
	private final Set<AccountField> fields;

	AccountExtension(AccountField... fields) {
		this.fields = Arrays.stream(fields).collect(Collectors.toSet());
	}

	@Override
	public Set<AccountField> fields() {
		return fields;
	}
}
